
// 获取所有一级菜单项
var lis = document.querySelectorAll('.product_choice .product_list')
// 获取整个二级菜单
var promenu = document.querySelector('.product_menu')
// 获取所有二级菜单项
var promenulist = document.querySelectorAll('.product_menu .menu')
var liindex = 0;
lis.forEach(li => {
    li.liindex = liindex;
    liindex++;
    li.addEventListener('mouseenter', () => {
        promenu.style.height = 229 + 'px'
        promenulist.forEach(promenulist => {
            promenulist.style.display = 'none'
        })
        promenulist[li.liindex].style.display = 'block';
    })
    li.addEventListener('mouseleave', () => {
        promenu.style.height = 0 + 'px'
    })
})
promenu.addEventListener('mouseenter', () => {
    promenu.style.height = 229 + 'px'
})
promenu.addEventListener('mouseleave', () => {
    promenu.style.height = 0 + 'px'
})